library(ggplot2)

dfpH<-read.csv("1L2_pH.csv")

#create line plot
ggplot(dfpH, aes(x=pH, y=Mean_RelativeActivity)) +
  geom_point(size=3)+
  geom_line(size=0.6)+
  geom_errorbar(data = dfpH, aes(ymin=Mean_RelativeActivity-StDev, ymax=Mean_RelativeActivity+StDev), width=0.1) + scale_y_continuous(breaks = c(0,20,40,60,80,100)) + 
  scale_x_continuous(breaks = c(4,4.5,5,5.5,6,6.5,7,7.5,8,8.5))+
  theme_minimal() +
  labs(
    title = "pH",
    x = "pH",
    y = "Relative DNase activity (%)"
  )+
  theme(axis.text.x = element_text(size = 16), axis.text.y = element_text(size = 16), axis.title.y = element_text(size=20), axis.title.x = element_text(size=20), title = element_text(size = 16), legend.title = element_blank(), legend.text = element_text(size=16), plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"))

ggsave("pH.pdf", width = 20, height = 15, units = "cm")